package com.yesep.learn.design.behavioral.command;

/**
 * 风扇
 */
public class Fan implements IDevice {

    private int temperature;

    public Fan(int initialTemperature) {
        this.temperature = initialTemperature;
    }

    public int getTemperature() {
        return temperature;
    }

    public void setTemperature(int temperature) {
        this.temperature = temperature;
    }

    @Override
    public void turnOn() {
        System.out.println("Fan is on at " + temperature + "°C.");
    }

    @Override
    public void turnOff() {
        System.out.println("Fan is off.");
    }
}